package com.hp.es.dao;

import com.hp.es.bean.Book;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;

import java.util.List;

/**
 * @author zhaohp
 * @Title: BookRepository
 * @ProjectName hpBoot-es
 * @date 2020/5/22 15:56
 * @Description:
 */

public interface BookRepository extends ElasticsearchRepository<Book, Integer> {

    /**
     * 根据名字查询书籍列表
     * @param name
     * @return  List<Book>
     */
    List<Book> findBookByName(String name);

    /**
     * 根据id删除书籍
     * @param id
     * @return  List<Book>
     */
    void deleteBookById(Integer id);

}
